import request from '@/plugin/axios'


export function getMenuList(params) {
    return request({
        url: '/upms/module/list',
        method: 'get',
        params: request.adornParams(params)
    })
}

export function getMenuTree(params) {
    return request({
        url: '/upms/module/tree',
        method: 'get',
        params: request.adornParams(params)
    })
}
export function getMenu(id) {
    return request({
        url: '/upms/module/info/' + id,
        method: 'get',
    })
}
export function getModulePath(id) {
    return request({
        url: '/upms/module/path/' + id,
        method: 'get',
    })
}
export function saveMenu(data) {
    return request({
        url: '/upms/module/save',
        method: 'post',
        data
    })
}

export function saveAuthorityBtn(data) {
    return request({
        url: '/upms/module/saveAuthorityBtn',
        method: 'post',
        data
    })
}

export function updateMenu(data) {
    return request({
        url: '/upms/module/update',
        method: 'put',
        data: data
    })
}
export function delMenu(id) {
    return request({
        url: '/upms/module/delete/' + id,
        method: 'delete',
    })
}

/**
 * 查询用户标记的快捷菜单那
 */
export function getusershortcutmenu() {
    return request({
        url: '/upms/module/usershortcutmenu',
        method: 'get',
        params: request.adornParams({})
    })
}